# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-pytest-tornado
pkgver=0.8.1
pkgrel=7
pkgdesc='A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications.'
arch=('any')
license=('Apache')
url='https://github.com/eugeniy/pytest-tornado'
depends=('python-pytest' 'python-tornado' 'python-setuptools')
source=("https://github.com/eugeniy/pytest-tornado/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('e655ee9e28461c68b6cc642dbbb203a31154305a603951641e795c605f55970243bb9f7a8858a44bf70faba3d647bea6cf1525f2f9655a968cabbea43beec3d6')

build() {
  cd pytest-tornado-$pkgver
  python setup.py build
}

check() {
  # Hack entry points by installing it

  cd pytest-tornado-$pkgver
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  python setup.py install --root="$PWD/tmp_install" --optimize=1
  PYTHONPATH="$PWD/tmp_install$site_packages:$PYTHONPATH" py.test
}

package() {
  cd pytest-tornado-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
}

# vim:set ts=2 sw=2 et:
